import console from 'console'
import request, { requestMock, requestMock2 } from '../utils/request'

interface IShopUser {
  shopName: string,
  shopLicense: string,
  shopBrand: string,
  shopField: string,
  shopCity: string,
  shopTel: string,
  shopManager: string
}
interface IUserInfo {
  adminname?: string,
  password?: string,
}
interface IRegisterParams {
  tel: string,
  password: string,
}
interface IMemberParams {
  key: number,
  membernumber: number,
  name: string,
  sort: string,
  discount: number,
  profilenumber: number,
  point: number,
  price: number,
  balance: number,
  tel: number,
  status: string,
}
// 获取当前商户的信息
export const getShopUserApi = (id:string) => request.get(`/shopUsers/${id}`)

// 修改当前商户的信息
export const patchShopUserApi = (id: string, params: IShopUser) => request.patch(`shopUser/${id}`, params)

// 获取登录信息
export const postLoginApi = (params: IUserInfo) => requestMock.post('/admin/login', params)
// 获取登录信息
// export const postLoginApi = (params: IUserInfo) => request.post('/shopUsers', params)

// 注册用户信息
export const postRegisterUser = (params: IRegisterParams) => requestMock2.post(`/api/user/dofinishregister`, params)

// 获取 所有的会员信息
export const getMemberListApi = () => request.get<any, IMemberParams[]>('/dayReport')